﻿using System;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Collections.Generic;

namespace PeteBrown.ConferenceTrivia.Web.Services
{
    [ServiceContract(Namespace = "urn:services.conferencetrivia.petebrown")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class TriviaService
    {
        [OperationContract]
        public IList<QuestionAndAnswer> GetTrivia()
        {
            using (var context = new TriviaEntities())
            {
                return context.QuestionAndAnswers.ToList<QuestionAndAnswer>();
            }
        }

        
    }
}
